<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script>
window.onload = function(){

var makeLine = function(context, angle, radius){
    context.moveTo(radius+10, radius+10);
    
    for(var i = 0; i<360; i++){
        angle = i;
        context.lineTo(Math.cos(angle)*radius+radius, Math.sin(angle)*radius+radius);
        context.moveTo(radius+10, radius+10);
        setTimeout(context.stroke(), 50);
    }

};

var events = function(canvasId){
    var canvas = document.getElementById(canvasId);
    var context = canvas.getContext('2d');
    context.lineWidth=5;
    context.strokeStyle="#FF0000";
    context.moveTo(50, canvas.height-50);
    context.lineTo(canvas.width-50, 50);
    context.stroke();
    makeLine(context, 1, 100);

}('myCanvas');



// draw stuff here
};
</script>
</head>
<body>
<canvas id="myCanvas" width="578" height="200">
</canvas>
</body>


</html>